package com.heima.verification_code_work;

import java.util.Random;
import java.util.Scanner;

public class Code {
    public static String getLoginCode() {
        String loginCode = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
        String code = "";
        Random rand = new Random();
        for (int i = 0; i < 4; i++) {
            int index = rand.nextInt(loginCode.length());
            code += loginCode.charAt(index);
        }
        return code;
        // System.out.println(code);
    }
}
